#include "KinematicObjectManager.h"
#include "KinematicObject.h"
#include "Error.h"

namespace Engine
{
	void KinematicObjectManager::RegisterKinematicObject(KinematicObject* obj)
	{
		auto it = m_objects.find(obj ->GetGameObjectID());
		if(it != m_objects.end()) 
		{
			Error("Attempting to register the same GameObject twice with KinematicObjectManager");
			return;
		}

		m_objects[obj ->GetGameObjectID()] = obj;
	}

	void KinematicObjectManager::UnregisterKinematicObject(unsigned int id)
	{
		auto it = m_objects.find(id);
		if(it != m_objects.end())
			m_objects.erase(it);
	}

	KinematicObjectMap* KinematicObjectManager::GetKinematicObjects()
	{
		return &m_objects;
	}
}